Jerry Greenough
Cubic Spline Fitting
This case study demonstrates the calculation of a piecewise cubic spline that runs through a given set of points. This function is written in C++ and uses the linear algebra package Armadillo in order to order to solve the tri-diagonal form for determining the coefficients of the cubic polynomial segments. (See the Wolfram article Cubic Splines for details concerning the mathematics).
The source code is available for download here:
Copyright © 2018 JGX Software Solutions LLC. All Rights Reserved.